@BMailMerge @P@ICopyright Gold Disk Inc., Jan, 1993. Close-up added by Don Cox, Feb.93.
This genie will load a tab or comma delimited merge file and print multiple copies of the current document. It will substitute the merge string in appropriate places. In this version, if the names of the fields end in a numeral (e.g. ADDR1, ADDR2, etc), blank lines will be closed up.
In order to delimit a field as a merge field, you must surround the merge
text with double guillemots. Example:««Name»»
Open guillemot: alt-9
Closing guillemot: alt-0
*/
parse arg filename
if ~show(l, "rexxsupport.library") then
if ~addlib("rexxsupport.library",0,-30) then
call exit_msg("Please install the rexxsupport.library in your libs: directory before running this Genie")
signal on error
signal on syntax
signal on break_c
signal on break_d
signal on break_e
signal on halt
signal on ioerr
address command
call SafeEndEdit.rexx()
call ppm_SetBatchMode(1)
call ppm_AutoUpdate(0)
cr = '0a'x
npages = ppm_NumPages()
if npages = 0 then exit_msg("You must have a merge document prepared to run this Genie.")